package samples.duty_chain_mode;

import samples.duty_chain_mode.enums.DutyEnum;
import samples.duty_chain_mode.handler.InfluxDBHandler;
import samples.duty_chain_mode.handler.MySQLHandler;
import samples.duty_chain_mode.handler.OPCHandler;

public class DutyChainTest {
    public static void main(String[] args) {
//        DataSourceChain dataSourceChain = new DataSourceChain();
//        dataSourceChain.addHandler(new MySQLHandler());
//        dataSourceChain.addHandler(new InfluxDBHandler());
//        dataSourceChain.addHandler(new OPCHandler());
//
//        dataSourceChain.handle(DutyEnum.INFLUXDB_STRATEGY);

        MySQLHandler mySQLHandler = new MySQLHandler();
        InfluxDBHandler influxDBHandler = new InfluxDBHandler();
        OPCHandler opcHandler = new OPCHandler();
        mySQLHandler.setNextHandler(influxDBHandler);
        influxDBHandler.setNextHandler(opcHandler);

        mySQLHandler.handleRequest(DutyEnum.INFLUXDB_STRATEGY);
    }
}
